<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopCartTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_cart', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')       ->default(0)->comment('用户标识');
            $table->bigInteger('merchant_medicine_id') ->default(0)->comment('药品id');
            $table->bigInteger('merchant_id')   ->default(0)->comment('店铺id');
            $table->bigInteger('merchant_medicine_spu_id')  ->default(0)->comment('商品属性id');
            $table->decimal('unit_price')       ->default(0)->comment('加入时的商品单价');
            $table->integer('num')              ->default(0)->comment('商品数量');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::dropIfExists('shop_cart');
    }
}
